package com.sc.smartcommunity.controller;


import com.sc.smartcommunity.domain.Mall;
import com.sc.smartcommunity.service.MallService;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/malls")
public class MallController {

    @Autowired
    private MallService mallService;

    // 处理获取商场列表的请求
    @GetMapping("/list")
    @Operation(summary = "获取商场列表")
    public List<Mall> getMallList(Integer type) {
        return mallService.getAllMalls(type);
    }
}